@tailwind base;
@tailwind components;
@tailwind utilities;
@import './reset-antd.less';

:root {
  // --bg-color: #fff;
  // --primary-color: #3e69f6;
  // --secondary-color: #dee8ff;
  // --thin-color: #f5f7fb;
  // --border-color: #e5e7eb;
  --edit-cell-color: #ffff0020;
}

::-webkit-scrollbar {
  width: 6px;
  // height: 12px;
}

::-webkit-scrollbar-thumb {
  background-color: #00000020;
  border-radius: 4px;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
    font-family: Arial, sans-serif;
  }
}

// 页面宽度小于1366px
@media screen and (max-device-width: 1366px) {
  html{
    min-width: 1360px;
  }
}

#app {
  width: 100%;
  height: 100%;
  // overflow: hidden;
}

* {
  box-sizing: border-box;
  border: 0 solid var(--border-color);
}

ul,
li {
  padding: 0;
  list-style: none;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
}

.link-border {
  position: relative;

  &::before {
    position: absolute;
    top: 8px;
    left: -2px;
    width: 6px;
    height: calc(100% - 16px);
    border: 2px solid var(--primary-color);
    border-right: none;
    content: '';
  }
}

.border-primary {
  border-color: var(--primary-color);
}

.table-link {

  &::after,
  &::before {
    position: absolute;
    top: -50%;
    right: 0;
    display: inline-block;
    width: 8px;
    height: calc(100% + 3px);
    border-color: var(--primary-color);
    border-style: solid;
    border-width: 0;
    content: '';
  }
}

.ant-table-row-level-1 {
  .ant-table-cell-with-append {
    &::before {
      position: absolute;
      top: 0px;
      right: 0;
      width: 100%;
      height: 2px;
      background-color: #fff;
      content: '';
    }
  }

  .table-link {
    &::after {
      border-left-width: 2px;
    }
  }
}

.ant-table-row-selected {
  .ant-table-cell-with-append {
    &::before {
      background-color: var(--secondary-color) !important;
    }
  }
}

.ant-table-row-level-0+.ant-table-row-level-1 {
  .table-link {
    &::after {
      border-top-width: 2px;
    }
  }
}

.ant-table-row-level-1+.ant-table-row-level-0 {
  .table-link {
    &::before {
      border-top-width: 2px;
    }
  }
}

.ant-table-row-level-1:last-child .table-link {
  &::after {
    border-bottom-width: 2px;
  }
}

.table-row-new td:not(.ant-table-cell-fix-right) {
  background-color: var(--edit-cell-color) !important;
}

.selected-row td:not(.ant-table-cell-fix-right) {
  background-color: var(--heavy-color) !important;
}

.disabled-row td:not(.ant-table-cell-fix-right) {
  background-color: #f5f5f5 !important;
}

.table-row-suit td:not(.ant-table-cell-fix-right) {
  pointer-events: none;
}

.table-row-readonly-not-last td:not(.ant-table-cell-fix-right) {
  position: relative;
  background-color: #00000008 !important;
  &::before {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      cursor: not-allowed ;
      content: "";
  }
}
.table-row-readonly-not-last-plus td:not(.ant-table-cell-fix-right) {
  position: relative;
  background-color: var(--disabled-bg-color) !important;
  &::before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    cursor: not-allowed ;
    content: "";
}
}

.table-row-readonly {
  pointer-events: none;
}

.ant-input-suffix {
  max-width: 48px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.table-row-disabled {
  // color: var(--disabled-text-color) !important;
  background-color: var(--disabled-bg-color) !important;
  pointer-events: none;

  // .ant-table-cell-fix-right {
  // background-color: transparent !important;
  // }
  // .ant-input,
  // .ant-input-suffix,
  // .ant-btn,
  // .ant-tag {
  // color: var(--disabled-text-color) !important;
  // }
  .ant-btn {
    color: var(--disabled-text-color) !important;
  }

  .ant-tag {
    color: #f5f5f5 !important;
  }

  .ant-select-disabled {
    .ant-select-selector {
      background-color: transparent !important;
    }
  }

  .ant-input-disabled {
    background-color: transparent !important;
  }

  .ant-tag {
    color: var(--disabled-text-color) !important;
    border-color: var(--disabled-text-color) !important;
  }

  .ant-table-cell-with-append {
    &::before {
      background: none;
    }
  }
}

.table-row-selected {
  background-color: var(--secondary-color) !important;

  .ant-table-cell-fix-right {
    background-color: var(--secondary-color) !important;
  }
}

.edit-table {
  .ant-table-row {
    background-color: #00000005;

    .can-edit-cell {
      background-color: var(--bg-color);
    }
  }
}

.hidden-boder {
  border: none !important;
  box-shadow: none !important;

  *:focus {
    border: none;
    box-shadow: none;
  }
}

.form-style-flex {
  &.ant-form {
    display: flex;
    flex-flow: row wrap;

    .ant-picker {
      width: 100%;
    }
  }
}

.choose-org-modal {
  .ant-modal-confirm-body {
    justify-content: center;
  }

  .ant-modal-confirm-content {
    margin-block-start: 0 !important;
  }

  .org-list {
    padding: 12px;
    text-align: center;

    .list-item {
      padding: 24px;
      font-weight: 600;
      background-color: var(--thin-color);
      border: 1px solid transparent;
      border-radius: 8px;
      cursor: pointer;

      &:not(:last-child) {
        margin-bottom: 16px;
      }

      &:hover {
        color: var(--primary-color);
        background-color: var(--secondary-color);
        border: 1px solid var(--primary-color);
      }
    }
  }
}

.ant-modal div[aria-hidden="true"] {
  display: none !important
}

.system-loading-box {
  position: fixed;
  top: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #ffffff99;

  >div {
    position: absolute;
    width: 100%;
    height: 100%;
  }
}

.print-style {
  font-size: 18px;
  font-family: 'SimSun';
}
.print-style-landscape {
  font-size: 12px;
  font-family: 'SimSun';
}
.print-table {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
}
.print-table-item {
  padding: 4px;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
}
.disabled-style {
  filter: opacity(0.6);
  pointer-events: none;
}
.readnoly-style {
  pointer-events: none;
}
.card-item {
  border: 1px solid #dfdfdf !important;
  .item-header{
    background-color: var(--thin-color);
    &::after{
      border-color: transparent !important;
    }
  }
}